package com.app.micaihu.view.army.dialog

import com.app.base.BaseDialogFragment
import com.app.micaihu.R
import kotlinx.android.synthetic.main.army_member_del_dialog.*

/**
 * 成员列表删除
 */
class ArmyMemberDelDialog : BaseDialogFragment() {

    override fun getLayoutId() = R.layout.army_member_del_dialog
    private var isApply = false
    override fun setData() {
    }

    override fun addListeners() {
        tvCancel.setOnClickListener { dismiss() }
        tvApply.setOnClickListener {
            if (isApply) {
                tvApply.setCompoundDrawablesWithIntrinsicBounds(R.mipmap.army_member_select_off, 0, 0, 0)
            } else {
                tvApply.setCompoundDrawablesWithIntrinsicBounds(R.mipmap.army_member_select_on, 0, 0, 0)
            }
            isApply = !isApply
        }
        tvOk.setOnClickListener {
            onDelMemberClickListener?.onDelMemberClick()
        }
    }
    private var onDelMemberClickListener: OnDelMemberClickListener? = null

    interface OnDelMemberClickListener {
        fun onDelMemberClick()
    }

    fun setOnDelMemberClickListener(onDelMemberClickListener: OnDelMemberClickListener) {
        this.onDelMemberClickListener = onDelMemberClickListener
    }

}